package com.zm.shop.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class Email implements Serializable {

    private String title;

    private String content;

    private List<String> receiverList = new ArrayList<>();

    public Email() {
    }

    public Email(String title, String content, String ...receiver) {
        this.title = title;
        this.content = content;
        // 把数组转成一个集合
        List<String> c = Arrays.asList(receiver);
        receiverList.addAll(c);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<String> getReceiverList() {
        return receiverList;
    }

    public void setReceiverList(String receiver) {
        this.receiverList.addAll(Arrays.asList(receiver));
    }

}
